#pragma once
#include <type_traits>
#include <iostream>
using std::ostream;

#include "../public/constants.hpp"
#include "../public/exception.hpp"

#include "../container/RBtree.hpp"
#include "../functor/functor_ease_dump.hpp"

namespace bla {
	template<typename _type>
	class set {
	public:
		//using define
		using sizeType = _containerSizeType;
		using differenceType = _containerSizeType;
		using valueType = _type;
		using pointerType = _type * ;
		using referenceType = _type & ;
		using iterator = RBTreeIterator<valueType, valueType, _identitySingleFunctor<valueType>,
			_identitySameTypeCompareFunctor<valueType>, _sameTypeLessThanCompareFunctor<valueType>>;
	private:
		RBTree<valueType, valueType, _identitySingleFunctor<valueType>, 
			_identitySameTypeCompareFunctor<valueType>, _sameTypeLessThanCompareFunctor<valueType>> _rbt;
	public:
		inline sizeType size() { return _rbt.size(); };
		inline const sizeType size() const { return _rbt.size(); };
		bool find(valueType v) {
			return _rbt.find(v);
		}
		bool insert(valueType v) {
			return _rbt.insert(v);
		}
		bool remove(valueType v) {
			return _rbt.remove(v);
		}
		template<typename _type>
		friend ostream& operator<< (ostream &os, const set<_type>& li);
	};
	template<typename _type>
	ostream & operator<<(ostream & os, const set<_type>& s)
	{
		os << s._rbt;
		return os;
	}
}
